import  request  from '@/utils/request'


// 请求登录的返回值token 类型
export interface LoginTokenType {
    token: string
}

// 用户信息的返回值类型
export  interface UserInfoType {
    routes: string[];
    buttons: string[];
    roles: string[];
    name: string;
    avatar: string;

}

// 请求登录
export const reqLogin = (username:string,password:string) => {
    return request.post<null,LoginTokenType>('/admin/acl/index/login', {username,password})
}

// 请求用户信息
export const reqGetUserInfo = () => {
    return request.get<null,UserInfoType>(`/admin/acl/index/info`)
}

// 退出登录
export const reqLogout = () => {
    return request.post<null,null>(`/admin/acl/index/logout`)
}